package com.distribution.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.distribution.common.core.domain.entity.SysUser;
import com.distribution.system.domain.dto.AgentProxyProductDTO;
import com.distribution.system.domain.dto.UpdateSubAgentCommissionByDeductPercentDTO;
import com.distribution.system.domain.entity.CmccDaProduct;
import com.distribution.system.domain.entity.CmccDaProxyProductManage;
import com.distribution.system.domain.req.ProxyProductManageListReq;
import com.distribution.system.domain.vo.ProductProxyVO;
import com.distribution.system.domain.vo.ProxyProductVO;
import com.distribution.system.domain.dto.UpdateDaProxyProductDTO;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 * 代理卡信息表(CmccDaProxyCardManage)表服务接口
 *
 * @since 2023-05-21 16:08:27
 */
public interface CmccDaProxyProductManageService extends IService<CmccDaProxyProductManage> {
    void updateAgentProxyProduct(UpdateDaProxyProductDTO updateDaProxyProductDTO);

    void updateSubAgentCommissionByDeductPercent(UpdateSubAgentCommissionByDeductPercentDTO updateSubAgentCommissionByDeductPercentDTO);

    void unifiedCommission(CmccDaProduct cmccDaProduct);

    ProxyProductVO selectAgentProxyProductVO(AgentProxyProductDTO agentProxyProductDTO);

    List<ProductProxyVO> selectProxyProductList(ProxyProductManageListReq proxyProductManageListReq);

    void updateAllAgentProxyProductStatus(String productCode, Integer productState);

    void updateAgentProxyProductStatus(Long userId, List<String> productCodeList, Integer cardStatus);

    // 给下级代理添加所有商品管理
    @Transactional
    void addAllProxyProductManageToSubAgent(SysUser supSysUserAgent, SysUser subSysUserAgent);

    @Transactional
    void addProxyProductManageToAllAgent(CmccDaProduct cmccDaProduct);

    BigDecimal getCommissionByDeduct(BigDecimal supCommission, Double superDeduct);
}
